//
//  YDTableViewController.m
//  CRM
//
//  Created by ios on 16/7/19.
//  Copyright © 2016年 YD_iOS. All rights reserved.
//

#import "YDTableViewController.h"

@interface YDTableViewController () <UISearchControllerDelegate,UISearchBarDelegate>


@property (nonatomic, strong) UISearchBar *searchBar;

@property (nonatomic, strong) UISearchController *searchController;

@end

@implementation YDTableViewController

- (instancetype)init
{
    if (self = [super init]) {
        [self createTableView];
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.definesPresentationContext = YES;
    [self setAutomaticallyAdjustsScrollViewInsets:YES];
    [self setExtendedLayoutIncludesOpaqueBars:YES];
    
   

    if (_searchBarType == SearchBarTypeTableViewHeader) {
        self.tableView.tableHeaderView = self.searchController.searchBar;
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark -  ======================tableView模块============================
#pragma mark  tableView 的创建
- (void)createTableView
{
    self.tableView = [[UITableView alloc] init];
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    self.tableView.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight);
    [self.view addSubview:self.tableView];
}

#pragma mark -Table view data source
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 0;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
    }
    
    return cell;
}






@end
